import java.util.Scanner;

public class test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        System.out.println(removeDuplicates(str));
    }
    public static String removeDuplicates(String s) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if(stringBuilder.isEmpty()){
                stringBuilder.append(s.charAt(i));
                continue;
            }
            if(s.charAt(i)==stringBuilder.charAt(stringBuilder.length()-1)){
                //重复
                stringBuilder.deleteCharAt(stringBuilder.length()-1);
            }else{
                stringBuilder.append(s.charAt(i));
            }
        }
        return stringBuilder.toString();
    }
}
